const joi = require("joi");
const account = joi.string().alphanum().min(5).max(16).required();
const password = joi
  .string()
  .pattern(/^(?![0-9]+$)[a-z0-9]{1,50}$/)
  .min(6)
  .max(16)
  .required();

const nickname = joi.string().min(4).max(16).required();
const email = joi.string().email().required();

exports.login_limit = {
  body: {
    account,
    password,
  },
};

exports.register_limit = {
  body: {
    account,
    password,
    email,
  },
};

exports.nickname_limit = {
  body: {
    account,
    nickname: nickname,
  },
};

exports.email_limit = {
  body: {
    account,
    email,
  },
};

exports.changePassword_limit = {
  body: {
    account,
    oldPassword: password,
    newPassword: password,
  },
};
